home *** CD-ROM | disk | FTP | other *** search
-
- The 'FreeFont' package contains Turbo Pascal Units that work together with
- the Borland BGI to allow you to display text in any direction with any slant
- using BGI stroked fonts. There are two units included. FFONT50.TPU is the
- unit to be used with Turbo Pascal version 5.0 and contains the following
- procedures and functions :
-
-
- PROCEDURE FFSetTextStyle(pF:POINTER;Rotation:REAL;Size:REAL);
- PROCEDURE FFSetTextOptions(SlantAngle:REAL;isBold:BOOLEAN);
- PROCEDURE FFSetRotation(Rotation:REAL);
- PROCEDURE FFSetSlant(Slant:REAL);
- PROCEDURE FFSetSize(Size:REAL);
- PROCEDURE FFWriteHeader;
- FUNCTION FFCharWidth(ch:CHAR):INTEGER;
- FUNCTION FFTextWidth(S:STRING):INTEGER;
- FUNCTION FFTextHeight:INTEGER;
- PROCEDURE FFDrawChar(CH:CHAR);
- PROCEDURE FFStringOut(St:STRING);
- PROCEDURE FFStringOutXY(X,Y:INTEGER;S:STRING);
-
-
- For version 5.5, FFONT55.TPU defines the object 'FontObj' which has these
- methods defined :
-
- PROCEDURE SetTextStyle(pF:POINTER;Rotation:REAL;Size:REAL);
- PROCEDURE SetTextOptions(SlantAngle:REAL;isBold:BOOLEAN);
- PROCEDURE ReadHeader;
- PROCEDURE SetRotation(Rotation:REAL);
- PROCEDURE SetSlant(Slant:REAL);
- PROCEDURE SetSize(Size:REAL);
- PROCEDURE WriteHeader;
- PROCEDURE GetRotatedXY(X,Y:INTEGER;var SX,SY:INTEGER);
- PROCEDURE GetSlantedXY(X,Y:INTEGER;var SX,SY:INTEGER);
- FUNCTION CharWidth(ch:CHAR):INTEGER;
- FUNCTION TextWidth(S:STRING):INTEGER;
- FUNCTION TextHeight:INTEGER;
- PROCEDURE DrawChar(CH:CHAR);
- PROCEDURE StringOut(St:STRING);
- PROCEDURE StringOutXY(X,Y:INTEGER;S:STRING);
-
-
- With the exception of the 'FF' preceding the procedures and functions in
- FFONT50.TPU, descriptions of both units are identical.
-
-
- **************************************************************************
-
- PROCEDURE SetTextStyle(pF:POINTER;Rotation:REAL;Size:REAL);
-
- PURPOSE - Initializes the font data structure. SlantAngle is set to 0
- and Bold is turned off. Does not require a graphics video mode.
-
- **** MUST BE CALLED BEFORE ANY OTHER FREEFONT PROCEDURE OR FUNCTIONS !!
-
- DESCRIPTION - pF points to a '.CHR' file that has been loaded into memory
- or linked into your '.EXE' file. See the RegisterBGIFont
- function on page 359 of the Turbo Pascal Reference Guide for
- a description of how to do this.
-
- Rotation is in degrees and starts with 0 being horizontal
- and increasing in a counterclockwise direction.
-
- Size works the same way the BGI version does, with 4 as the
- design size for each font.
-
- EXAMPLE - FF.SetTextStyle(@aFont,30,8);
- Initalizes the structure for 'aFont' going up from left to right
- at double the normal size of the font.
-
- **************************************************************************
-
- PROCEDURE SetTextOptions(SlantAngle:REAL;isBold:BOOLEAN);
-
- PURPOSE - Sets the SlantAngle and Bold switch.
-
- DESCRIPTION - SlantAngle is in degrees and starts at 0, increasing in a
- counterclockwise direction.
-
- isBold turns the Bold switch on or off.
-
- EXAMPLE - FF.SetTextOptions(-15,true);
- Prepares the current font for BOLD, ITALIC text.
-
- **************************************************************************
-
- PROCEDURE ReadHeader;
-
- PURPOSE - Internal Use. Not in the interface section of FFONT50.TPU.
-
- DESCRIPTION - Procedure called by FF.SetTextStyle to load font data
- into the structure.
-
- EXAMPLE - NONE.
-
- **************************************************************************
-
- PROCEDURE SetRotation(Rotation:REAL);
-
- PURPOSE - Sets the rotation value and initializes several internal
- calculation variables.
-
- DESCRIPTION - Rotation is in degrees and starts at 0, increasing in a
- counterclockwise direction.
-
- EXAMPLE - FF.SetRotation(180);
- Sets rotation to horizontal, text displayed upside down.
-
- **************************************************************************
-
- PROCEDURE SetSlant(Slant:REAL);
-
- PURPOSE - Sets the SlantAngle value and initializes several internal
- calculation variables.
-
- DESCRIPTION - Slant is in degrees with 0 being upright text, and increasing
- in a counterclockwise direction.
-
- EXAMPLE - FF.SetSlant(180);
- Sets the slant angle to 180 degrees ( text displayed backwards ).
-
- **************************************************************************
-
- PROCEDURE SetSize(Size:REAL);
-
- PURPOSE - Sets the Size of the text.
-
- DESCRIPTION - Fonts are designed at a font size of 4. A value of 8 will
- display double size text. Values below 3 yield poor quality
- text. Decimal values are permitted.
-
- EXAMPLE - FF.SetSize(10);
- Sets the Display size to 2.5 times design size.
-
- **************************************************************************
-
- PROCEDURE WriteHeader;
-
- PURPOSE - Allows inspection of the data structure.
-
- DESCRIPTION - Uses the textmode writeln() procedure to display the font
- header data.
-
- EXAMPLE - FF.WriteHeader;
-
- **************************************************************************
-
- PROCEDURE GetRotatedXY(X,Y:INTEGER;var SX,SY:INTEGER);
-
- PURPOSE - Internal Use. Not in the interface section of FFONT50.TPU.
-
- DESCRIPTION - Procedure called by FF.DrawChar().
-
- EXAMPLE - NONE.
-
- **************************************************************************
-
- PROCEDURE GetSlantedXY(X,Y:INTEGER;var SX,SY:INTEGER);
-
- PURPOSE - Internal Use. Not in the interface section of FFONT50.TPU.
-
- DESCRIPTION - Procedure called by FF.DrawChar().
-
- EXAMPLE - NONE.
-
- **************************************************************************
-
- FUNCTION CharWidth(ch:CHAR):INTEGER;
-
- PURPOSE - Primarily for internal use.
-
- DESCRIPTION - Gets the width of a character in pixels from the font
- structure. DOES NOT ACCOUNT FOR SIZE !! Use FF.TextWidth to
- determine the actual display width of text.
-
- EXAMPLE - CW := CharWidth(CH);
-
- **************************************************************************
-
- FUNCTION TextWidth(S:STRING):INTEGER;
-
- PURPOSE - Returns the width in pixels of a string.
-
- DESCRIPTION - Uses FF.Charwidth and Size to calculate the display width
- of a string. This is NOT always going to be along the X axis
- of the screen.
-
- EXAMPLE - TW := FF.TextWidth(S);
- String S is TW pixels wide regardless of it's direction.
-
- **************************************************************************
-
- FUNCTION TextHeight:INTEGER;
-
- PURPOSE - Returns the height of the current font.
-
- DESCRIPTION - Uses the font height from the font structure and the size
- of the font to return the height of the text displayed.
- This is NOT always going to be along the Y axis of the screen.
-
- EXAMPLE - inc(Y,FF.TextHeight);
- Increases the value of Y by the height of the current font.
-
- **************************************************************************
-
- PROCEDURE DrawChar(CH:CHAR);
-
- PURPOSE - Primarily for internal use.
-
- DESCRIPTION - Draws a character beginning at the current CP using the
- current font's rotation, slant, bold attribute and size.
-
- EXAMPLE - FF.DrawChar(CH);
-
- **************************************************************************
-
- PROCEDURE StringOut(St:STRING);
-
- PURPOSE - Displays a string at the current CP using the BGI text
- justification and color settings.
-
- DESCRIPTION - Uses FF.DrawChar to display a string.
-
- EXAMPLE - FF.StringOut('Hello World!');
- Displays 'Hello World' at the CP.
-
- **************************************************************************
-
- PROCEDURE StringOutXY(X,Y:INTEGER;S:STRING);
-
- PURPOSE - Displays a string at (X,Y) using the BGI text justification and
- color settings.
-
- DESCRIPTION - Uses FF.DrawChar to display a string.
-
- EXAMPLE - FF.StringOutXY(10,100,'I LOVE using FreeFont !!');
- Displays 'I LOVE using FreeFont !!' at (10,100).
-
- **************************************************************************
-
-
- To obtain the source code for the FreeFont TPUs send $10.00 to :
-
- Michael E. Garey
- 912 Blue Mountain Ln.
- Antioch, TN 37013
-
- Please specify a 3.5" or 5.25" diskette.
-
- Thank you and enjoy using FreeFont.
-
- Michael E. Garey
- ----------------end-of-author's-documentation---------------
-
- Software Library Information:
-
- This disk copy provided as a service of
-
- The Public (Software) Library
-
- We are not the authors of this program, nor are we associated
- with the author in any way other than as a distributor of the
- program in accordance with the author's terms of distribution.
-
- Please direct shareware payments and specific questions about
- this program to the author of the program, whose name appears
- elsewhere in this documentation. If you have trouble getting
- in touch with the author, we will do whatever we can to help
- you with your questions. All programs have been tested and do
- run. To report problems, please use the form that is in the
- file PROBLEM.DOC on many of our disks or in other written for-
- mat with screen printouts, if possible. The P(s)L cannot de-
- bug programs over the telephone.
-
- Disks in the P(s)L are updated monthly, so if you did not get
- this disk directly from the P(s)L, you should be aware that
- the files in this set may no longer be the current versions.
-
- For a copy of the latest monthly software library newsletter
- and a list of the 1,000+ disks in the library, call or write
-
- The Public (Software) Library
- P.O.Box 35705
- Houston, TX 77235-5705
- (713) 665-7017
-